package cn.laixueit.controller;

import cn.laixueit.pojo.Message;
import cn.laixueit.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/message")
public class MessageController {

    @Autowired
    private MessageService messageService;

    @PostMapping("/save")
    public Boolean save(Message message){
        try {
            messageService.save(message);
        } catch (Exception e) {
            return false;
        }
        return true;
    }

}
